<style>
/* 重写样式 */
.fui-header.block {
    display: block;
}

.fui-tab {
    margin: 0;
}

.fui-tab a {
    height: 2.2rem;
    line-height: 2.2rem;
}

.fui-tab:after {
    display: none;
}
.nickname {
    color: #50b6fe;
}
    .shop-index-page .menu {height: auto; background: #fff;}
    .shop-index-page .menu .item {height: auto; width: 1%; padding: 0.5rem 0; margin: 0; font-size: 0.7rem; color: #636363; text-align: center; display: table-cell;position: relative;}
    .shop-index-page .menu .item:after  {font-size: 0.7rem;position: absolute;content: '';left:-1px;top:0.5rem;bottom:0.5rem;border-left:1px solid #d9d9d9;}
    .content-empty{padding:1rem 0;margin:0;}
source{
    min-width: 100%;
    min-height: 100%;
    height: auto;
    width: auto;
}
.btn.btn-success{background:#F5F0FF}
.btn.btn-success, .jy-btn1{border-radius:1rem;background:linear-gradient(95.84deg, #EDF6FF 5.59%, #F0F3FF 51.42%, #F5F0FF 97.24%)}
.btn.btn-blue, .jy-btn2{border-radius:1rem;background:linear-gradient(136deg, #7783EA, #4e6ef2, #7274f9, #9f66ff)}
.jy-topbg{background:linear-gradient(to bottom, #f8dfd8, #F5F0FF, #F0F3FF, #f7f7f7)}
</style>
<div class='fui-page fui-page-current'>
	<div class="fui-content">
	<div class="jy-topbg" style="top:0;padding-top: 0.5rem;">
	<div class="jy-content">
	<div class="radius" style="background: #fff;">
		<div class="fui-cellone radius" style="background: #fff;">
			<div class="fui-cellone-text bold">
				{{pagedata.chat.title}}
			</div>
		</div>
		<div class="chatlog">
		<div ng-repeat="item in pagedata.list">
			<div class="fui-cellone" ng-if="item.role=='user'">
			<div class="fui-cellone-label" style="width:5rem"></div>
			<div class="fui-cellone-text">
				<div class="text radius" style="background:#e6f7ff;padding:0.5rem">
				<div class="fui-cellone" style="padding:0;">
					<div class="fui-cellone-text" style="color:#999">User</div>
					<div class="fui-cellone-remark noremark">{{item.createtime}}</div>
				</div>
				{{item.content}}
				<div class="r" style="padding-top:0.2rem">
				<i onclick="play_audio($(this).next())" ng-click="pagedata.pausePlay($index)" class="icon {{pagedata.playkey!=index?'icon-iconfontplay2':'icon-iconfontstop'}}" style="color:#7783EA;font-size:0.75rem;margin-right:0.5rem">
				<audio style="display:none;" ng-src="{{tomedia(item.mp3)}}" loop="loop"></audio>
				</i>
				<i data-value="{{item.mp3}}"ng-click="tool.clip(item.mp3)" class="icon icon-icondownload" style="color:#7783EA;font-size:0.75rem"></i>
				</div>
				</div>
			</div>
			</div>
			<div class="fui-cellone" ng-if="item.role!='user'">
				<div class="fui-cellone-text">
				<div class="text radius" style="background:#f2f2f2;padding:0.5rem">
					<div class="fui-cellone" style="padding:0;">
						<div class="fui-cellone-text">AI</div>
						<div class="fui-cellone-remark noremark">{{item.createtime}}</div>
					</div>
					<div class="text">{{item.content}}</div>
					<div class="gray r" style="padding-top:0.2rem">以上内容由 {{pagedata.chat.model}} 生成</div>
				</div>
				</div>
				<div class="fui-cellone-label" style="width:5rem"></div>
			</div>
		</div>
		</div>
	</div>
	<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
	</div>
</div>
</div>
<div ng-include="sys_html('common/_footer')"></div>
<script>
 /**
         * 停止非当前播放项
         * @param _type 0为当前播放为audio，1为当前播放为video
         * @param _index 当前播放所以位置索引
*/	
scope.pagedata.pausePlay=function(index){
	if(scope.pagedata.playkey==index){
		scope.pagedata.playkey=-1;
	}else{
		scope.pagedata.playkey=index;
	}
	var _audios = $('audio')
    //关闭audio
	for(var i = 0; i < _audios.length; i++){
		if(i!=index){
			_audios[i].pause();
			_audios[i].currentTime = 0;
		}
	}
	scope.$evalAsync();
}
</script>